<?php

!defined('BASE_PATH')&&die('forbidden');


class core_view_viewbase{
	
	private static $data = array();
	
	public static function set_var($key,$value){
		
		self::$data[$key] = $value;
		
	}
	
	public static function load($__template){
		if (file_exists($__template)) {
			extract(self::$data,EXTR_PREFIX_SAME,'__');
			//self::$data = array();
			include($__template);
		}else {
			exit('template file : "' . $__template . '" lost!');
		}
	}
	
	public static function render($__template){
		ob_start();
		self::load($__template);
		$buf = ob_get_contents();
		ob_end_clean();
		return $buf;
	}
	
}

?>